<?php 
if (!isset($_SESSION)) {
  session_start();
}
class construction extends CI_Controller  {

        /**
        * Index Page for this controller.
        *
        * Maps to the following URL
        * 		http://example.com/index.php/welcome
        *	- or -  
        * 		http://example.com/index.php/welcome/index
        *	- or -
        * Since this controller is set as the default controller in 
        * config/routes.php, it's displayed at http://example.com/
        *
        * So any other public methods not prefixed with an underscore will
        * map to /index.php/welcome/<method_name>
        * @see http://codeigniter.com/user_guide/general/urls.html
        */
       protected $configs;
       function __construct()
        {
            parent::__construct();
            $this->load->helper('url');
            $this->load->library('smarty3','','smarty');
            $this->load->model('pushclimb/content_model');
            $this->content_model=new content_model();
        }
        public function index()
	{
            
            $projects=$this->content_model->getByType("17");
            $Data["projects"]=$projects;
            $Data["project"]=$projects[0];
            $this->smarty
                    ->assign('_SESSION', $_SESSION)
                    ->assign('Data', $Data)
                    ->display("pushclimbing/pages/10_project");
        }
        function detail($alias=""){
            $projects=$this->content_model->getByType("17");
            $Data["projects"]=$projects;
            foreach ($projects as $h){
                if($h->Alias==$alias){
                    $Data["project"]=$h;
                }
            }
            
            $this->smarty
                    ->assign('_SESSION', $_SESSION)
                    ->assign('Data', $Data)
                    ->display("pushclimbing/pages/10_project");
        }
        
}

